﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Presentation.Helpers
{
    //this class includes some helper methods
    public static class Helpers
    {
        // TODO: Change roles names to Admin and Member
        public static string ROLE_ADMIN         = "admins";
        public static string ROLE_TEAM_MEMBER   = "members";

        //checks if user is in admin role
        public static bool IsAdmin(this ViewPage pg)
        {
            return pg.Page.User.IsInRole(ROLE_ADMIN);
        }
        public static bool IsAdmin(this ViewUserControl pg)
        {
            return pg.Page.User.IsInRole(ROLE_ADMIN);
        }
    }
}